package cn.kgc.ssmmodulardemo.entity.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NonNull;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * 面向用户添加的视图对象
 */
@Data
@ApiModel(description = "添加用户类")
public class AddUserVo {
    @NotNull(message = "用户名不能为空")
    @ApiModelProperty(notes = "用户名",required = true)
    private String userName;
    @ApiModelProperty(notes = "用户密码",required = true)
    @NotNull(message = "密码不能为空")
    private String userPassword;
    @Min(value = 16,message = "最小值是16")
    @ApiModelProperty(notes = "用户年龄 最小16",required = true,example = "20")
    private Integer age;
    @ApiModelProperty(notes = "用户手机号 ",required = true,example = "13429824536")
   @Pattern(regexp =  "/^1[34578]\\d{9}$/",message = "请输入正确的手机号")
    private String phone;
    @ApiModelProperty(notes = "家庭地址 ",required = true,example = "中国")
   @NotNull(message = "地址不能为空")
    private String assress;
}
